// 对数据进行劫持操作
import { observe } from "./observe.js"
export function defineReavtive (data, key, val) {
  if (arguments.length === 2) val = data[key]
  let childOb = observe(val)
  Object.defineProperty(data, key, {
    enumerable: true,
    configurable: true,
    get () {
      console.log('在访问属性:' + key + '值为:' + val)
      return val
    },
    set (newValue) {
      val = newValue
      childOb = observe(newValue)
      console.log('在设置属性:' + key + '值为:' + val)
    }
  })
}